# Contributor: Jurvis Tan <jurvis@squareup.com>
# Maintainer: Jurvis Tan <jurvis@squareup.com>
pkgname=fulcrum
_pkgname=Fulcrum
pkgver=1.9.7
pkgrel=0
pkgdesc="Fast & nimble SPV Server for BCH and BTC"
url="https://github.com/cculianu/Fulcrum"
arch="all !riscv64" # limited by rocksdb
license="GPL-3.0-or-later"
makedepends="rocksdb-dev<7.10 zlib-dev bzip2-dev zeromq-dev qt5-qtbase-dev"
subpackages="$pkgname-admin:admin:noarch $pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/cculianu/$_pkgname/archive/v$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"
options="!check"

build() {
	qmake-qt5 PREFIX=/usr $_pkgname.pro
	make
}

package() {
	make install INSTALL_ROOT="$pkgdir"
	mv "$pkgdir"/usr/bin/$_pkgname "$pkgdir"/usr/bin/$pkgname
}

admin() {
	pkgdesc="Fulcrum Admin CLI"
	depends="python3"
	mkdir -p "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/bin/${_pkgname}Admin "$subpkgdir"/usr/bin/$pkgname-admin
}


sha512sums="
2ed69827127b3dec2895f0e749151cab7f435c5a8f28302c0734f4902ea50f40514f73a6807c134274f6848dbd82108e5e63a8b24e046ba7024ad8033402d8cc  fulcrum-1.9.7.tar.gz
"
